package com.zhanlv.composer

import android.util.Log
import java.net.Socket

class ClientWorkThread(private val socket: Socket): Thread(){
    companion object{
        const val TAG = "ClientThread"
    }

    override fun run() {
        while (true){
            val inputStream = socket.getInputStream()
            //Log.w(TAG, "inputStream available: " + inputStream.available())

            val buffer = ByteArray(1024)

            var res = inputStream.read(buffer)
            var response = String(buffer, 0, res, Charsets.UTF_8)

            Log.w(TAG, "response: $response")
        }
    }
}